package clinicaveterinaria;

import java.awt.BorderLayout;
import java.awt.EventQueue;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.JLabel;
import javax.swing.JTextField;
import java.awt.Font;
import java.awt.Color;
import javax.swing.JButton;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;

public class CadVeterinario extends JFrame {

	private JPanel contentPane;
	private JTextField txtCPF;
	private JTextField txtNome;
	private JTextField txtTelefone;
	private JTextField txtEndereco;
	private JTextField txtEmail;
	private JTextField txtEspecializacao;
	private JTextField txtCRMV;

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					CadVeterinario frame = new CadVeterinario();
					frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the frame.
	 */
	public CadVeterinario() {
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds(100, 100, 450, 529);
		contentPane = new JPanel();
		contentPane.setBackground(new Color(153, 204, 255));
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		setContentPane(contentPane);
		contentPane.setLayout(null);
		
		JLabel label = new JLabel("Digite o nome do veterinario:");
		label.setBounds(46, 61, 292, 14);
		contentPane.add(label);
		
		txtNome = new JTextField();
		txtNome.setColumns(10);
		txtNome.setBounds(36, 86, 253, 20);
		contentPane.add(txtNome);
		
		JLabel label_1 = new JLabel("CPF do veterinario:");
		label_1.setBounds(46, 117, 258, 14);
		contentPane.add(label_1);
		
		txtCPF = new JTextField();
		txtCPF.setColumns(10);
		txtCPF.setBounds(36, 142, 149, 20);
		contentPane.add(txtCPF);
		
		JLabel label_2 = new JLabel("Telefone do veterinario:");
		label_2.setBounds(46, 173, 275, 14);
		contentPane.add(label_2);
		
		txtTelefone = new JTextField();
		txtTelefone.setColumns(10);
		txtTelefone.setBounds(36, 198, 149, 20);
		contentPane.add(txtTelefone);
		
		JLabel label_3 = new JLabel("Endereco do veterinario:");
		label_3.setBounds(46, 229, 275, 14);
		contentPane.add(label_3);
		
		txtEndereco = new JTextField();
		txtEndereco.setColumns(10);
		txtEndereco.setBounds(36, 254, 268, 20);
		contentPane.add(txtEndereco);
		
		JLabel label_4 = new JLabel("Email do veterinario:");
		label_4.setBounds(46, 285, 258, 14);
		contentPane.add(label_4);
		
		txtEmail = new JTextField();
		txtEmail.setColumns(10);
		txtEmail.setBounds(36, 316, 268, 20);
		contentPane.add(txtEmail);
		
		JLabel label_5 = new JLabel("Especializacao do veterinario:");
		label_5.setBounds(46, 347, 317, 14);
		contentPane.add(label_5);
		
		txtEspecializacao = new JTextField();
		txtEspecializacao.setColumns(10);
		txtEspecializacao.setBounds(36, 372, 235, 20);
		contentPane.add(txtEspecializacao);
		
		JLabel label_6 = new JLabel("CRMV do veterinario:");
		label_6.setBounds(46, 403, 304, 14);
		contentPane.add(label_6);
		
		txtCRMV = new JTextField();
		txtCRMV.setColumns(10);
		txtCRMV.setBounds(36, 426, 159, 20);
		contentPane.add(txtCRMV);
		
		JLabel label_7 = new JLabel("Cadastro de Veterinario");
		label_7.setFont(new Font("Trajan Pro", Font.BOLD, 25));
		label_7.setBounds(46, 11, 368, 26);
		contentPane.add(label_7);
		
		JButton btnCancelar = new JButton("Cancelar");
		btnCancelar.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
			}
		});
		btnCancelar.setBounds(94, 468, 77, 23);
		contentPane.add(btnCancelar);
		
		JButton btnEnviar = new JButton("Enviar");
		btnEnviar.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				Clinica.medicos.add(
						new Veterinario(
								txtNome.getText(),
								txtCPF.getText(),
								txtTelefone.getText(),
								txtEndereco.getText(),
								txtEmail.getText(),
								txtEspecializacao.getText(),
								txtCRMV.getText()
								)
						
						);
				
			}
		});
		btnEnviar.setBounds(198, 468, 73, 23);
		contentPane.add(btnEnviar);
	}

}
